package com.tianhui.consignortwofei.mvp.ui.activity.hetong.impl;

import android.text.TextUtils;

import com.fgs.common.api.CommonConfig;
import com.tianhui.consignortwofei.api.ContractApiService;
import com.tianhui.consignortwofei.constant.OrderType;
import com.tianhui.consignortwofei.mvp.model.enty.OrderCondition;
import com.tianhui.consignortwofei.mvp.model.enty.OrderInfo;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

import io.reactivex.Observable;

/**
 * @author fgs
 * @date 2020/8/27
 * @description 货源单
 **/
public class ContractStatusHeTong implements HeTongIOrderStatus {
    @Override
    public Observable getOrderListObservable(OrderCondition orderCondition) {
        Map<String, String> map = new HashMap<>();
        map.put("limit", "10");
//        map.put("isblack", "1");
        map.put("order", "desc");
        map.put("sort", "createTime");
        map.put("page", orderCondition.page + "");
        if (!TextUtils.isEmpty(orderCondition.searchKey)) {
            map.put("contractno", orderCondition.searchKey);
        }
        return CommonConfig.getInstance().create(ContractApiService.class).contractList(map);
    }

    @Override
    public Observable getOrderDetailObservable(OrderCondition orderCondition) {
        return null;
    }

    @Override
    public List getOrderDetailList(OrderInfo orderInfo) {

        return null;
    }


    @Override
    public int getOrderStatusType() {
        return OrderType.TYPE_SOURCE;
    }

    @Override
    public String getOrderStatus(OrderInfo orderInfo) {
        String str = "状态：<font color='#FF0000'>" + orderInfo.isstatetext + "</font>";
        return str;
    }

    @Override
    public String getDispatchNumber(OrderInfo orderInfo) {
        return null;
    }

    @Override
    public String getFreight(OrderInfo orderInfo) {
        return null;
    }

    @Override
    public String getSearchHint() {
        return "请输入合同编号";
    }

}
